import urllib.request
url = 'https://weibo.cn/7742594271/info'

headers = {
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36',
    'Cookie': '_T_WM=449943caf4f922f391825cfaded17038; SCF=Aqt-YtuwRibMeYf6vLkEo9rNFS5rDQqCksBYCQt_cAxhxNNEBBKkXE1qdZ5FTXgYMGFoaXcAdwga324l_x20KX0.; SUB=_2A25K3n8xDeRhGeRM71oQ8C_MwjmIHXVpkv75rDV6PUJbktAbLUjkkW1NU_WvqUy8oUtjGk0jzxkZM81AhxNi6NHd; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WWpim17ROLBBwJnjcJEz8oE5JpX5KzhUgL.FozEShnpeh271K-2dJLoI7Uowsp7INy7; SSOLoginState=1742344033; ALF=1744936033'
}

# 请求对象的定制
request = urllib.request.Request(url, headers=headers)
# 模拟浏览器向服务器发送请求
response = urllib.request.urlopen(request)
# 获取响应的数据
content = response.read().decode('utf-8')

# 将数据保存到本地
with open('cookie.html', 'w', encoding='utf-8') as f:
    f.write(content)

